﻿Imports System.Data.OleDb
Imports DTO
Public Class HocKyDao
    Public Function LayDanhSachHocKy() As List(Of HocKyDto)
        Dim ds As New List(Of HocKyDto)
        Dim cn As OleDbConnection = DataProvider.ConnectDB()
        Dim sql = "Select * from HOCKY"
        Dim cmd As New OleDbCommand(sql, cn)
        Dim dr As OleDbDataReader
        dr = cmd.ExecuteReader()
        Dim hk As New HocKyDto()
        While (dr.Read())
            hk = New HocKyDto()
            hk.MaHK = dr("MaHK")
            hk.TenHocKy = dr("TenHK")
            ds.Add(hk)
        End While
        cn.Close()
        Return ds
    End Function
End Class
